#include <stdio.h>
#include "log.h"
#include "app_runner.h"
#include "string.h"
#include "ota_version.h"
#include "daemon_process.h"
int main(int argc, char const *argv[])
{  
    if(argc < 2)
    {
        printf("please input (app|ota|daemon)\n" );
        return -1;
    }

    if(strcmp(argv[1], "app") == 0)
    { 
        //主应用程序 
        app_runner_start();

    }
    else if(strcmp(argv[1], "ota") == 0)
    { 
        //ota升级 
        ota_version_start();

    }
    else if(strcmp(argv[1], "daemon") == 0)
    { 
        //守护进程 
        daemon_process_start();

    }

    else if(strcmp(argv[1], "update") == 0)
    { 
        //手动检查并更新版本 
        ota_version_checkAndUpdate();
    }
    else if(strcmp(argv[1], "version") == 0)
    { 
        //打印版本信息 
        ota_version_print();
    }

    else  
    {
         printf("please input (app|ota|daemon)\n" );
        return -1;
    }
    

     
    return 0;
}
